package com.dingup.provider.feign.server.student;

import com.dingup.api.model.student.StudentCourseInformation;
import com.dingup.provider.service.student.StudentCourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by wancheng on 2018/11/29.
 */
@RestController()
@RequestMapping("/feign/student")
public class StudentFeign {

    @Autowired
    StudentCourseService studentCourseService;

    @RequestMapping(value = "/get_student_course_info.do", method = RequestMethod.POST)
    public StudentCourseInformation getStudentCourseInfo(@RequestParam("studentId") String studentId,
                                                         @RequestParam("classId") Integer classId,
                                                         @RequestParam("userAccount") String userAccount) {
        StudentCourseInformation course = studentCourseService.getByStudentIdAndClassId(studentId, classId, userAccount);

        return course;
    }
}
